﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Principal;
using Base.Users;

namespace SharedBusinessLogic.Security
{
	public sealed class TpIdentity : IIdentity
	{
		#region Members

		private User user;

		#endregion

		#region Construction

		public TpIdentity(User user)
		{
			if (user == null)
				throw new ArgumentNullException("user");

			this.user = user;
		}

		#endregion

		#region Properties

		public bool IsAuthenticated
		{
			get
			{
				return true;
			}
		}

		public string AuthenticationType
		{
			get
			{
				return "TpAuthentication";
			}
		}

		public string Name
		{
			get { return user.UserName; }
		}

		public User User
		{
			get { return this.user; }
		}

		#endregion

	}
}
